#ifndef SERVER
#define SERVER

#include <iostream>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <pthread.h>
#include <netdb.h>
#include <cstring>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
#include <vector>
#include "comms.h"

class server : public comms
{
public:
	server();
	~server();
	void startServerThread(int port);
	static void *runServer(void* args);
	void establishConnection(int sock_);

	struct accessHelper
	{
		server* This;
		void* actual_arg ;
		int sock;
		int serverPort;
		accessHelper( server* t, void* p, int sock, int serverPort )
		: This(t), actual_arg(p),sock(sock),serverPort(serverPort) {}
	};

	int sock;
	int serverPort;
};



#endif
